/************************************************************************
 * The code is owned by mainframer.cn and Shang Tao
 * Without aproval of mainframer.cn and Shang Tao, removing the copyright
 * infomation is regarded as invassion of proprietary copyright
 ***********************************************************************/
package com.mr.qa.dao.impl;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.mr.qa.bo.UploadedFile;

public class UploadedFileDAO extends BaseHibernateDAO
{
    private static final Log log = LogFactory.getLog(UploadedFileDAO.class);
    public UploadedFileDAO()
    {
    }
    public void save(UploadedFile uploadedFile)
    {
        //log.debug("saving UploadedFile instance");
        try
        {
            getSession().save(uploadedFile);
            //log.debug("save successful");
        }
        catch(RuntimeException re)
        {
            //log.error("save failed", re);
            throw re;
        }
    }
    
    public void delete(UploadedFile uploadedFile) 
    {
        log.debug("deleting UploadedFile instance");
        try 
        {
            getSession().delete(uploadedFile);
            log.debug("delete successful");
        }
        catch(RuntimeException re)
        {
            log.error("delete failed", re);
            throw re;
        }
    }
    
    public UploadedFile findById(java.lang.String id) 
    {
        log.debug("getting UploadedFile instance with id: " + id);
        try 
        {
            UploadedFile instance = (UploadedFile) getSession().get("com.mr.qa.bo.UploadedFile", id);
            return instance;
        }catch(RuntimeException re)
        {
            log.error("get failed", re);
            throw re;
        }
    }    
}
